SUBROUTINE fcn(n, p, fval)
  USE commonvars
  IMPLICIT NONE

  INTEGER, INTENT(IN)     :: n
!!$  REAL(8), INTENT(IN)     :: p(:)
  REAL(8), INTENT(IN)     :: p(n)
  REAL(8), INTENT(OUT)    :: fval

  EXTERNAL                :: moments
  
  CALL moments(n, p, fval)

END SUBROUTINE fcn
